home *** CD-ROM | disk | FTP | other *** search
- /*
- File: PreferencesDialogWindow.cp
-
- Contains: A simple dialog window recipe
-
- Written by: Dave Falkenburg
-
- Copyright: Copyright © 1993-1999 by Apple Computer, Inc., All Rights Reserved.
-
- You may incorporate this Apple sample source code into your program(s) without
- restriction. This Apple sample source code has been provided "AS IS" and the
- responsibility for its operation is yours. You are not permitted to redistribute
- this Apple sample source code as "Apple sample source code" after having made
- changes. If you're going to re-distribute the source, we require that you make
- it clear in the source that the code was descended from Apple sample source
- code, but that you've made changes.
-
- Change History (most recent first):
- 8/19/1999 Karl Groethe Updated for Metrowerks Codewarror Pro 2.1
- 11/12/94 DRF Set default & cancel items as well as cursor tracking.
- 9/9/94 DRF Removed redundant #include.
-
- */
-
- #include "PreferencesDialogWindow.h"
-
- TPreferencesDialogWindow::TPreferencesDialogWindow() : TDialogWindow(kPreferencesDialogTemplateID)
- {
- // Because TDialogWindow::TDialogWindow has already created the dialog,
- // this is a great place to grab settings & setup the contents of the
- // dialog.
- //
- // Of course, if you do this you probably want to mark the DLOG
- // as not initially visible, then call ShowWindow just before returning.
- //
- // You should also setup UPPs for any user items in here, too.
-
- // Set up the default buttons
- // Isn’t it neat that these also work for modeless dialogs?
-
- SetDialogDefaultItem(fWindow,ok);
- SetDialogCancelItem(fWindow,cancel);
- SetDialogTracksCursor(fWindow,true);
- }
-
- void
- TPreferencesDialogWindow::ItemHit(short theItem)
- {
- switch (theItem)
- {
- case ok:
- case cancel:
- this->Close();
- delete this;
- break;
-
- default:
- break;
- }
- }
-